
import React, { Component } from 'react'
import { Tabs } from 'antd'
import _ from 'lodash'
import { address } from '@/Utils/apiConfig'
import './index.less'

const { TabPane } = Tabs

class TabsList extends Component {
  constructor(props) {
    super(props)
    this.state = {
      tabsList: [{ key: 'out', name: '外部节点模式' }, { key: 'bare', name: '云节点模式' }],
      mode: 'out',
    }
  }

  render() {
    return (
      <Tabs onChange={(mode) => this.setState({ mode })} defaultActiveKey={this.state.mode}>
        {
          this.props.children.length
            ? this.props.children.map((element, index) => {
              return (
                <TabPane tab={this.state.tabsList[index].name} key={this.state.tabsList[index].key}>
                  {element}
                </TabPane>
              )
            })
            : null
        }

      </Tabs>
    )
  }
}
export default TabsList

